clear all;
load /nfs/satmag_work/mnair/projects/longp/eef_data_2000_2009.mat eef;

y = eef(:,6) - eef(:,17); % eef - model

y = eef(:,6); % DATA ONLY

%y = eef(:,17); % model only


t = eef(:,1)';

periods = [ 4:0.1:32 ];

 
 
%periods = logspace(0,2);

% periods = 3:0.1:100;
% spectra = [];
for i = 1:length(periods),


x = [cos(2*pi*t/( periods(i)/24))' sin(2*pi*t/( periods(i)/24))'];	 
 
 
spectra_model_rem(i,:) = robustfit(x, y);

end;

semilogy(periods, spectra_model_rem(:,2).^2 + spectra_model_rem(:,3).^2,'r')

